home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / edit / jed207.lha / macros / blockstack next >
Text File  |  1993-01-04  |  922b  |  45 lines

  1. ; Block stack macros
  2. ; ==================
  3. ;
  4. ; These macros provide a LIFO stack for cutting and pasteing onto.
  5. ; (c) 1992-3 J.Harper
  6.  
  7. ; Setup stack counter -- set to unit 1 so 0 can be used for normal copying.
  8. (global `_stkct' 1)
  9.  
  10. ; Copies text to stack buffer.
  11. ; (stkcopy `sectionType')
  12. (macro `stkcopy'
  13. {
  14.     (local `sect' (arg 1 `s' `section> '))
  15.     (copy sect _stkct)
  16.     (= `_stkct' (+ _stkct 1))
  17.     (return 1)
  18. })
  19.  
  20. ; Cuts text to stack buffer.
  21. ; (stkcut `sectionType')
  22. (macro `stkcut'
  23. {
  24.     (local `sect' (arg 1 `s' `section> '))
  25.     (cut sect _stkct)
  26.     (= `_stkct' (+ _stkct 1))
  27.     (return 1)
  28. })
  29.  
  30. ; Inserts text from stack buffer.
  31. ; (stkins)
  32. (macro `stkins'
  33. {
  34.     (if (> _stkct 1)            ; Is anything on the stack?
  35.     {
  36.     (= `_stkct' (- _stkct 1))       ; Decrement counter
  37.     (insert `cb' _stkct)            ; Insert from clipboard
  38.     (return 1)
  39.     }
  40.     {
  41.     (settitle `Nothing on block stack.')
  42.     (return 0)
  43.     })
  44. })
  45.